<template>
  <el-menu
    class="menu-nav"
    router
    :default-active="currentPath"
    background-color="#424547"
    text-color="rgba(255,255,255,.8)"
    active-text-color="#63A5D2"
    :collapse="isCollapse">
    
    
    <el-menu-item index="/binding" v-if="userStatus===1">
      <i class="el-icon-share"></i>
      <span slot="title">绑定车辆</span>
    </el-menu-item>
    <el-menu-item index="/emap" v-if="userStatus===1">
      <i class="el-icon-orange"></i>
      <span slot="title">充电地图</span>
    </el-menu-item>
    
    <el-menu-item index="/eeletchart" v-if="userStatus===1">
      <i class="el-icon-circle-plus-outline"></i>
      <span slot="title">电耗统计图</span>
    </el-menu-item>
    <el-menu-item index="/info" v-if="userStatus===1">
      <i class="el-icon-user"></i>
      <span slot="title">个人中心</span>
    </el-menu-item>
  </el-menu>
</template>

<script>
export default {
  props: ['isCollapse'],
  data () {
    return {
      userStatus:1,
      currentPath: location.pathname
    }
  },
  mounted() {
    let flag = JSON.parse(sessionStorage.user).username
    if (flag ==='yulei') {
      this.userStatus = 0
    }else{
      this.userStatus = 1
    }
  },
}
</script>

<style lang="scss" scoped>
  .el-menu {
    border: none;
   
  }
  .menu-nav:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
    
  }
  
</style>
